home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex98.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  345 b   |  22 lines

  1. Program Example98;
  2.  
  3. { Program to demonstrate the exitproc function. }
  4.  
  5. Var
  6.   OldExitProc : Pointer;
  7.  
  8. Procedure MyExit;
  9.  
  10. begin
  11.   Writeln('My Exitproc was called. Exitcode = ',ExitCode);
  12.   { restore old exit procedure }
  13.   ExitProc:=OldExitProc;
  14. end;
  15.  
  16. begin
  17.   OldExitProc:=ExitProc;  
  18.   ExitProc:=@MyExit;
  19.   If ParamCount>0 Then
  20.     Halt(66);
  21. end.
  22.